<?php
/**
 * Created by PhpStorm.
 * User: lhuan
 * Date: 2019/11/4
 * Time: 19:41
 */
namespace app\index\model;

use think\Model;

class Config extends Model
{
    public $map = [];
    public $fields = '*';

    public function initialize()
    {
        parent::initialize();
    }

    public static function getConfigs()
    {
        return json_decode( Config::find(1)->text,true);
    }

    public static function modify($param = [])
    {
        return Config::where(['id' => 1])->update(['text'=>json_encode($param)]);
    }
}